﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GraphicalSVN.GraphicSource;
using log4net;
using log4net.Config;
using System.IO;
using GraphicalSVN.GraphicSource.Dto;

namespace SVNGraphicalSource
{
    class Program
    {
        private static readonly ILog logger = LogManager.GetLogger(typeof(Program));
        static void Main(string[] args)
        {
            logger.Info("Started App");
            logger.Debug("Read Settings");
            Settings cs = Settings.Default;
            logger.Debug("read Settings into GeneralInfo");
            GeneratorInfo gi = new GeneratorInfo() 
            { 
                Repository = cs.Repository,
                WorkingDirectory = cs.WorkingDirectory,
                FPS = cs.FPS,
                SecPerDay = cs.SecondsPerDay,
                ShowDirectoryNames = cs.ShowDirectoryNames,
                Width = cs.Width,
                Height = cs.Height
            };

            logger.Debug("GeneratorInfo Contents" + gi.ToString());

            try
            {
                GraphicalSource Generator = new GraphicalSource(gi);
                Generator.Generate();
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message, ex);
            }
            finally
            {
                logger.Info("Exiting App");
            }
        }
    }
}
